<template>
  <div class="block sorter">
    <el-pagination
      :page-size="pageSize"
      :total="total"
      layout="prev, pager, next, jumper"
      @current-change="handleCurrentChange"
      :hide-on-single-page="true">
    </el-pagination>
  </div>
</template>

<script>
  export default {
    name: "Sorter",
    props: {
      pageSize: Number,
      total: Number
    },
    methods: {
      handleCurrentChange(val) {
        // console.log(`当前页: ${val}`);
        this.$emit('currentPageChange', val)
      }
    },
  }
</script>

<style scoped>
  .sorter {
    margin: 25px;
    text-align: center;
  }
</style>
